<div xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:a4j="http://richfaces.org/a4j">

  <ui:composition template="view_users_listing_template.xhtml">

    <ui:define name="users_search_method">
      <a4j:region id="search_users_region">
        <!-- search form -->
        <h:form id="searchForm">
          <h:outputScript target="#{pageJsTarget}">
            jQuery(document).ready(function() {
              jQuery('#usersListingView\\:searchForm').focusFirst();
            });
          </h:outputScript>
          <h:inputText id="searchText"
            value="#{userManagementActions.searchString}"
            styleClass="directoryFilter" />
          <f:verbatim>&amp;nbsp;</f:verbatim>
          <h:commandButton id="searchButton"
            value="#{messages['command.search']}"
            action="#{contentViewActions.refreshAndRewind(contentViewName)}"
            onclick="document.getElementById('usersListingView:searchForm:searchButton').setAttribute('disabled', 'disabled');document.getElementById('usersListingView:searchForm:clearButton').setAttribute('disabled', 'disabled');"
            styleClass="button">
            <f:ajax execute="@form" render="usersPanel searchForm" />
          </h:commandButton>
          <h:commandButton id="clearButton"
            value="#{messages['command.clearSearch']}"
            action="#{userManagementActions.clearSearch}"
            onclick="document.getElementById('usersListingView:searchForm:searchButton').setAttribute('disabled', 'disabled');document.getElementById('usersListingView:searchForm:clearButton').setAttribute('disabled', 'disabled');"
            styleClass="button">
            <f:ajax execute="@form" render="usersPanel searchForm" />
          </h:commandButton>
          <a4j:status>
            <f:facet name="start">
              <h:graphicImage value="/img/standart_waiter.gif" />
            </f:facet>
          </a4j:status>
        </h:form>
      </a4j:region>
    </ui:define>

    <ui:define name="empty_content_view_label">
      <c:set var="emptySentence"
        value="#{nxu:test(contentView.translateEmptySentence, messages[contentView.emptySentence], contentView.emptySentence)}" />
      <a4j:outputPanel>
        <h:outputText value="#{emptySentence}"
          rendered="#{not empty userManagementActions.searchString and not empty emptySentence and documents.rowCount == 0 and not provider.hasError()}" styleClass="emptyResult emptyResultBig" />
      </a4j:outputPanel>
    </ui:define>

  </ui:composition>

</div>